# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=gerix-wifi-cracker
pkgver=1.1c3cd73
pkgrel=4
groups=('blackarch' 'blackarch-wireless' 'blackarch-misc')
pkgdesc='A graphical user interface for aircrack-ng and pyrit.'
arch=('any')
url='https://github.com/TigerSecurity'
license=('GPL')
depends=('aircrack-ng' 'xterm' 'pyqt3' 'python2')
makedepends=('git')
source=("git+https://github.com/TigerSecurity/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" README README-DEV CHANGELOG

  rm README README-DEV CHANGELOG

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 gerix.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

